package org.osomit.sacct.session.registry.iface;

import org.osomit.sacct.session.token.iface.Token;
import org.osomit.sacct.session.registry.impl.InMemorySessionTokenRegistryImpl;

import java.util.Collection;

import com.google.inject.ImplementedBy;

/**
 * @author Jian Fang (John.Jian.Fang@gmail.com)
 * 
 * Date: Jul 2, 2009
 */
@ImplementedBy(InMemorySessionTokenRegistryImpl.class)
public interface TokenRegistry<T extends Token> {

    public void addToken(T token);

    public void updateToken(T token);

    public T getToken(String id);

    public void deleteToken(String id);

    public int getTokenNumber();

    public Collection<T> getAllTokens();

    public void clear();
}
